home *** CD-ROM | disk | FTP | other *** search
/ Mac Expert 1995 Winter / Mac Expert - Winter 95.iso / Les fichiers / Communications / Communication ToolBox / Outils CTB ƒ / CCL Modem Tool 1.2 ƒ / CCL Script 2400 < prev    next >
Encoding:
Text File  |  1993-03-11  |  4.1 KB  |  219 lines  |  [mlts/slnk]

  1. ! 11/8/92 Modified GVC TelePort Serial ARA Script
  2. !         for use with Stalker's CCL Modem Tool.
  3. !
  4. ! 12/3/92 Improved disconnect logic
  5. !         Removed login logic (Eudora now does it)
  6. !         Added Manual dial logic
  7. !         
  8. ! 12/6/92 Changed disconnect logic to Inline (there's only one Settries var)
  9. !
  10. @ANSWER
  11. exit -6019
  12. @ORIGINATE
  13. !
  14. ! Talk to the modem at 2400 bps.  
  15. !
  16. serreset 2400, 0, 8, 1
  17. !
  18. ! &f  - recall factory settings
  19. ! &d0 - ignore DTR from DTE
  20. ! &k3 - Enable Hardware flow control
  21. ! w2  - Connect result code reports modem speed
  22. ! \q3 - Use RTS/CTS flow control in full-duplex mode
  23. ! \k0 - Enter command state but do not send break
  24. ! \j0 - Disable port rate adjust
  25. ! s7=60 - To allow for an international call
  26. !
  27. HSReset 1 0 0 0 1 0
  28. matchclr
  29. @LABEL 1
  30. note "Initializing the modem..." 3
  31. matchstr 1 4 "OK\13\10"
  32. write "AT&F&C1&D1\13"
  33. matchread 30
  34. note "Modem initialization failed, setting factory defaults." 3
  35. matchstr 1 4 "OK\13\10"
  36. write "AT&F\13"
  37. matchread 30
  38. ! Modem is not responding, abort
  39. jump 59
  40. !
  41. @LABEL 4
  42. matchclr
  43. ! If speaker on flag is true, turn on the speaker
  44. !
  45. pause 5
  46. matchstr 1 8 "OK\13\10"
  47. ifstr 2 6 "1"
  48. !Speaker Off
  49. write "ATM0\13"
  50. jump 7
  51. @LABEL 6
  52. !Speaker on low during connection after dialing
  53. write "ATM3L1\13"
  54. @LABEL 7
  55. matchread 30
  56. jump 59
  57. !
  58. ! The modem is ready so originate a call
  59. !
  60. !Initialize Retry counter
  61. settries 0
  62. @LABEL 8
  63. pause 5
  64. ! Check if Phone Number is empty
  65. ifstr 1 40 ""
  66. jump 41
  67. !@LABEL 40
  68. !ask 0 "Please enter Phone Number"
  69. !note "Dialing ^*" 3
  70. !write "ATDT^*\13"
  71. !jump 42
  72. @LABEL 40
  73. ask 1 "No Phone Number specified!\13Dial call manually and click OK."
  74. write "ATS7=120X1D\13"
  75. note "Listening for remote modem..."
  76. jump 42
  77. @LABEL 41
  78. note "CCL Script Rev .75\13Dialing ^1" 3
  79. write "ATDT^1\13"
  80. @LABEL 42
  81. !
  82. @LABEL 9
  83. matchstr 1  11 "CONNECT 1200\13\10"
  84. matchstr 2  12 "CONNECT 2400\13\10"
  85. matchstr 3  13 "CONNECT 4800\13\10"
  86. matchstr 4  14 "CONNECT 7200\13\10"
  87. matchstr 5  17 "CONNECT 9600\13\10"
  88. matchstr 6  18 "CONNECT 12000\13\10"
  89. matchstr 7  19 "CONNECT 14400\13\10"
  90. matchstr 8  51 "NO CARRIER\13\10"
  91. matchstr 9  50 "ERROR\13\10"
  92. matchstr 10 52 "NO DIAL TONE\13\10"
  93. matchstr 11 53 "BUSY\13\10"
  94. matchstr 12 54 "NO ANSWER\13\10"
  95. matchread 600
  96. note "No Connection, Retrying..."
  97. !
  98. @LABEL 10
  99. pause 30
  100. !Hangup first
  101. jsr 60
  102. ! Dial the number again
  103. inctries
  104. iftries 3 59
  105. jump 8
  106. !
  107. !
  108. ! Notice that all we do for different connect speeds is issue a 
  109. ! "Communicating at" message.  Remember, we locked the interface speed
  110. ! to 19,200 bps so we don't want to reset the serial speed after we connect.
  111. !
  112. @LABEL 11
  113. note "Communicating at 1200 bps." 2
  114. jump 15
  115. @LABEL 12
  116. note "Communicating at 2400 bps." 2
  117. jump 15
  118. @LABEL 13
  119. note "Communicating at 4800 bps." 2
  120. jump 15
  121. @LABEL 14
  122. note "Communicating at 7200 bps." 2
  123. jump 15
  124. @LABEL 17
  125. note "Communicating at 9600 bps." 2
  126. jump 15
  127. @LABEL 18
  128. note "Communicating at 12000 bps." 2
  129. jump 15
  130. @LABEL 19
  131. note "Communicating at 14400 bps." 2
  132. jump 15
  133. !
  134. ! Set CTS handshaking ON in the serial port (that's the 1 in the HSReset
  135. ! command below )
  136. !
  137. @LABEL 15
  138. HSReset 1 0 0 0 1 0 
  139. pause 15
  140. exit 0
  141. !
  142. !
  143. ! 50: error messages
  144. !
  145. @LABEL 50
  146. ! Modem returned Error
  147. exit -6021
  148. !
  149. @LABEL 51
  150. ! Modem returned No Carrier
  151. note "No Carrier, Retrying..."
  152. jump 10
  153. @LABEL 52
  154. ! Modem returned No Dial Tone
  155. exit -6020
  156. !
  157. @LABEL 53
  158. ! Modem returned Busy
  159. note "Busy, Retrying..."
  160. jump 10
  161. exit -6022
  162. !
  163. @LABEL 54
  164. ! Modem returned No Answer
  165. note "No Answer, Retrying..."
  166. jump 10
  167. exit -6023
  168. !
  169. @LABEL 59
  170. ! General Abort
  171. exit -6019
  172. !
  173. ! Hang up the modem
  174. !
  175. @HANGUP
  176. jsr 60
  177. serreset 2400, 0, 8, 1
  178. HSReset 0 0 0 0 0 0
  179. exit 0
  180. ! Disconnect subroutine
  181. @LABEL 60
  182. note "Hanging up..."
  183. matchclr
  184. matchstr 1 63 "OK\13\10"
  185. matchstr 2 63 "NO CARRIER\13\10"
  186. !There's only one Settries variable! (Yuck) and its used for Redialing
  187. !So we just have to put the hangup retires Inline instead of looping.
  188. pause 12
  189. write "+++"
  190. pause 12
  191. Flush
  192. write "ATH\13"
  193. matchread 20
  194. write "+++"
  195. pause 12
  196. Flush
  197. write "ATH\13"
  198. matchread 20
  199. write "+++"
  200. pause 12
  201. Flush
  202. write "ATH\13"
  203. matchread 20
  204. write "+++"
  205. pause 12
  206. Flush
  207. write "ATH\13"
  208. matchread 20
  209. write "+++"
  210. pause 12
  211. Flush
  212. write "ATH\13"
  213. matchread 20
  214. note "Error: Make sure modem disconnected properly!"
  215. pause 100
  216. !
  217. @LABEL 63
  218. write "ATZ\13"
  219. return